<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客注册</title>
    <link href="../static/images/me.jpg" th:href="@{/images/me.jpg}" rel="icon" type="image/x-ico">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
    <!-- 引入 layui.css -->
<!--    <link rel="stylesheet" href="//unpkg.com/layui@2.6.6/dist/css/layui.css">-->
    <link href="//cdn.bootcss.com/layer/3.0.1/skin/default/layer.css" rel="stylesheet">
</head>
<body>

<br>
<br>
<br>
<div class="m-container-small m-padded-tb-massive" style="max-width: 30em !important;">
    <div class="ur container">
        <div class="ui middle aligned center aligned grid">
            <div class="column">
                <h2 class="ui teal image header">
                    <div class="content" style="color: #0a001f" >
                        博客注册(
                        <a th:href="@{/login}">去登录</a>
                        ）
                    </div>

                </h2>
                <form class="ui large form" method="post" action="/logon">
                    <div class="ui  segment">
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="user icon"></i>
                                <input type="text" th:value="${user!= null ? user.getEmail:''}" name="email" placeholder="邮箱">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui left icon input">
                                <i class="lock icon"></i>
                                <input type="password" th:value="${user!= null ? user.getPassword():''}" name="password" placeholder="密码">
                            </div>
                        </div>

                        <div class="field">
                            <div class="ui left icon input">
                                <i class="lock icon"></i>
                                <input type="password" th:value="${user!= null ? user.getPassword():''}" name="passwordtwo" placeholder="再次确认密码">
                            </div>
                        </div>

                        <div class="fields">
                            <div class="field">
                                <input type="text" placeholder="邮箱验证码">
                            </div>
                            <div class="field">
                                <button id="btn_vertify_code" type="button" class="ui right floated button">获取验证码</button>
                            </div>
                        </div>

                        <button class="ui fluid large teal submit button">注 册</button>

                    </div>

                    <div class="ui error mini message"></div>
                    <div class="ui mini negative message" th:text="${msg}"></div>

                </form>

            </div>
        </div>
    </div>
</div>


<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<!-- 引入 layui.js -->
<!--<script src="https://unpkg.com/layui@2.6.6/dist/layui.js"></script>-->
<script src="//cdn.bootcss.com/layer/3.0.1/layer.min.js"></script>


<script>
    $('.ui.form').form({
        fields: {
            email: {
                identifier: 'email',
                rules: [{
                    type: 'empty',
                    prompt: '请输入邮箱'
                }]
            },
            password: {
                identifier: 'password',
                rules: [{
                    type: 'empty',
                    prompt: '请输入密码'
                }]
            },
            passwordtwo: {
                identifier: 'passwordtwo',
                rules: [{
                    type: 'match[password]',
                    prompt: '两次密码不同'
                }]
            }
        }
    });
    $('#btn_vertify_code').on('click',function () {
        //信息框-例2
        layer.msg('邮箱验证码发送成功,请接收');

    })

</script>

</body>
</html>